home *** CD-ROM | disk | FTP | other *** search
/ Knitting Made Easy / Knitting.iso / App / Patterns.dxr / behaviors_181_Scroll Arrow Behavior.ls < prev    next >
Encoding:
Text File  |  2002-04-18  |  613 b   |  34 lines

  1. property pScrollDelay, pClickedStatus, pDirection
  2.  
  3. on beginSprite me
  4.   pScrollDelay = 10
  5.   currentMember = the member of sprite me.spriteNum
  6.   if member(currentMember).name contains "up" then
  7.     pDirection = #up
  8.   else
  9.     pDirection = #down
  10.   end if
  11. end
  12.  
  13. on mouseDown me
  14.   pClickedStatus = 1
  15.   sendAllSprites(#scrollText, pDirection)
  16.   startTimer()
  17. end
  18.  
  19. on mouseLeave me
  20.   pClickedStatus = 0
  21. end
  22.  
  23. on mouseUp me
  24.   pClickedStatus = 0
  25. end
  26.  
  27. on mouseWithin me
  28.   if pClickedStatus = 1 then
  29.     if the mouseDown and (the timer > pScrollDelay) then
  30.       sendAllSprites(#scrollText, pDirection)
  31.     end if
  32.   end if
  33. end
  34.